package com.cecsmsserve.service;

import com.cecsmsserve.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cecsmsserve.util.result.CommonResult;

import java.io.UnsupportedEncodingException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 王郝浠
 * @since 2024-04-15
 */
public interface IUserService extends IService<User> {

    CommonResult register(User user);

    CommonResult login(String loginName, String password) throws UnsupportedEncodingException;

    CommonResult insert(User user);

    CommonResult update(User user);

    CommonResult selectByUsername(String username);

    CommonResult selectByRid(int rid);

    CommonResult selectByRidByPage(int rid, int current, int size);

    CommonResult selectById(int id);

    CommonResult selectByNameOrIdNum(String searchName);

    CommonResult getSum(int rId);

    CommonResult getUsersSum();

    CommonResult getDoctorSum();

    CommonResult getWorkerSum();

    // 获取待审核用户列表
    CommonResult getPendingAuditUsers();
    
    // 审核用户
    CommonResult auditUser(Integer userId, Integer auditStatus, String auditRemark);

    // 获取待审核用户列表
    CommonResult getPendingUsers(int page, int size);

    // 通过用户审核
    CommonResult approveUser(Integer id);

    // 拒绝用户审核
    CommonResult rejectUser(Integer id);
}
